package com.controller;

import com.aop.SystemLog;
import com.entity.Admin;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@RequestMapping("/adminController")
public class AdminController {

    @RequestMapping("/admins")
    @ResponseBody
    @SystemLog(methods = "管理员管理",module = "查询全部")
    public List<Admin> getAll(){
//        System.out.println("tttt");
//        Admin admin1 = new Admin("0001", "张三");
//        Admin admin2 = new Admin("0002", "王二");
//        ArrayList<Admin> admins = new ArrayList<Admin>();
//
//        admins.add(admin1);
//        admins.add(admin2);
//        return admins;
        return null;
    }
    @GetMapping("admin")
    @ResponseBody
    public String getById(){
        System.out.println("add");
        return "查询";
    }
    @PostMapping("admin")
    @ResponseBody
    public Integer add(Admin admin){
        System.out.println("add");
        System.out.println(admin);
        return 1;
    }
    @DeleteMapping("admin")
    @ResponseBody
    public Integer delete(){
        System.out.println("delete");
        return 2;
    }
    @PutMapping("admin")
    @ResponseBody
    public Integer update(){
        System.out.println("update");
        return 3;
    }
    @PatchMapping("admin")
    @ResponseBody
    public Integer patch(){
        System.out.println("patch");
        return 4;
    }

}
